package com.greyu.ysj.service;

import com.greyu.ysj.entity.User;
import com.greyu.ysj.model.ResultModel;
import com.greyu.ysj.utils.NodeItem;

import java.util.List;
import java.util.Map;

public interface UserService {

    User selectUserById(int userId);

    User selectByUserName(String username);
    
    User selectByUserId(int userId);
    
    User selectByPhone(String phone);
    
    User selectByEmail(String email);
    
    User selectByAvatar(String avatar);
   
    List<User> getAllUsers(Integer page, Integer rows, User user);
    
    int  getUserIDbyPhone(String phone);

    ResultModel addUserByPhone(User user);
    
    ResultModel addUserByEmail(User user);

    ResultModel deleteUser(int userId);

    ResultModel updateUser(int userId, User user);

    ResultModel updateAvatar(int userId, String avatar);
    //通过条件机进行查询用户列表
    List<User> selectAllUsers(User user);
    
    User getUserByPhoneAndLoginPwd(String phone,String loginPwd);
    
    List<User> getUserIDCard(Integer flag,Integer page,Integer row,String phone,Integer userId);
    
    int totalPages(Integer flag, Integer rows,String phone,Integer userId);
    //获取该用户的一代和二代的userId
    List<NodeItem> getTwoGeneration(Integer userId);
    //获取实名人数
    int realTotal(List<NodeItem> userIdList);
    //获取所有用户Id
    List<Integer> selectAlluserId();
    //
    int selectLeaderIdByuserId(Integer userId);
    //
    int getUserStart(Integer userId);
    User selectByPhoneAndCode(String phone,String area);

//	double getRewardValue(NodeItem nodeItem,int rootUserStar,boolean isFull,boolean isRoot, int maxTreeStar,boolean overStepFlag);
	double getRewardValue(NodeItem item, int rootUserStar, int maxUserStar, boolean isRoot);
//	double getRewardValue(NodeItem nodeItem,int rootUserStar,boolean isFull,boolean isRoot);
	List<User> selectUsersListbyUserId(Integer userId);

	int totalAllPages( Integer rows);
}
